#include <stdio.h>
#include "doss.h"

void notify(int cmd, void* parmeter)
{
	switch(cmd)
	{
	case CMD_UPDATE:
		printf("Updated the doss system!\n");
		break;
	case CMD_UPDATE_FRAME:
		{
			FRAMEDISPLAY_T* pfs = (FRAMEDISPLAY_T*) parmeter;

			printf("update the %d frame! rect: %d-%d-%d-%d\n", pfs->idFrame, pfs->rect.l, pfs->rect.t, 
				pfs->rect.r, pfs->rect.b);
			break;
		}
	case CMD_NOTIFY_ADVISE_LAYOUT:
		{
			LAYOUT_E* type = (LAYOUT_E*) parmeter;
			printf("system suggest you change the layout \n");
			printf(" use the NM mode is probely!\n");
			break;
		}
	default:
		break;
	}
}

int main()
{
	PROFILE_T prof = {
		400, 300, E_IMMOVABLE, 4, 3, LO_NN, 8, 0, NULL
	};
	Style_t sty = {
		2, 2, 2, 2, 2, 2, 2, 2, 2, LINE_ON
	};
	initLayout(prof, sty, &notify);
	setLayout(100, 200, E_IMMOVABLE);

	updateClientArea(200, 150);

	printf("Hit Test in %d frame!\n", hitTest(132, 56));
	
	return 0;
}
